home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.concentric.net!news
- From: mikolaj@concentric.net
- Newsgroups: comp.lang.c++
- Subject: Problems linking Turbo C++ with TASM
- Date: 9 Apr 1996 15:02:11 GMT
- Organization: Concentric Internet Services
- Message-ID: <4kdu5j$l2u@tribune.concentric.net>
- Reply-To: mikolaj@concentric.net
- NNTP-Posting-Host: cnc125038.concentric.net
- X-Newsreader: IBM NewsReader/2 v1.2.5
-
- Hi. I have a problem linking a Turbo C++ program with a Turbo Assembler
- module. C++ program calls an assembler routine, which has to take a file name from C++ as an array ex: char filename[]="file.dat" , or
- char *filename="file.dat". This is the C++ program:
- Can somebody tell me what I am doing wrong? Please? Thanks mikE!
- #include <fstream.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <ctype.h>
- fstream fp;
- extern "C" void asmroutine(char * filename);
- char * filename="file.dat";
- //or char filename[]="file.dat";
- void main()
- {
- asmroutine(filename);
- return;
- }
- this is the asm portion of code:
- ideal
- p386
- model small
- dataseg
- fhand dw ?
- codeseg
- public _asmroutine
- PROC _asmroutine
- arg filename:Word
- push bp
- mov bp,sp
- mov ax,@data
- mov ds,ax
- mov ax, 3D00H
- lea dx,[filename]
- int 21H
- jnc continue
- jmp exit
- continue:
- ...code follows...
- mov ah, 3Eh
- mov bx, [fhand]
- int 21h ;close file
- exit:
- pop bp
- ret
- endp _asmroutine
- END
-
-